package com.qiwenshare.file.constant;

public enum FileOperationTypeEnum {
    UPLOAD(1, "上传"),
    DOWNLOAD(2, "下载"),
    MODIFY(3, "修改"),
    DELETE(4, "删除")
    ;


    private int type;
    private String desc;
    FileOperationTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static FileOperationTypeEnum getEnum(int type) {
        for (FileOperationTypeEnum ele : FileOperationTypeEnum.values()) {
            if (ele.getType() == type) {
                return ele;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
